Skip to content

FROMLIST: soundwire: qcom: Fix off-by-one error in port exhaustion check - #1535

Open
Mohis-12 wants to merge 1 commit into
qualcomm-linux:qcom-6.18.yfrom
Mohis-12:Soundwire-port-exhaustion-fix
Open

Mohis-12 wants to merge 1 commit into
qualcomm-linux:qcom-6.18.yfrom
Mohis-12:Soundwire-port-exhaustion-fix

Conversation

@Mohis-12

@Mohis-12 Mohis-12 commented Nov 25, 2026 •

Copy link
Copy Markdown

Qualcomm SoundWire master ports are indexed from 1, with bit 0 reserved. Commit 6ccec91 changed the exhaustion check from pn > maxport to pn >= maxport, incorrectly rejecting the last valid port. On RB3Gen2, the right WSA883x VISENSE port maps to master port 8, causing speaker playback to fail with -EBUSY. This change includes bit 0 in the bitmap search and restores the correct bounds check.
Lore: https://lore.kernel.org/linux-arm-msm/20261012-wip-obbardc-soundwire-qcom-fix-port-off-by-one-v1-1-81f1a4c9c73a@oss.qualcomm.com/
CRs-Fixed: 4759091

@qswat-orbit-external

Copy link
Copy Markdown

Merge Check Failed: No CR Numbers Found

Error: No Change Request numbers were found.

Please add Change Request numbers to your pull request description in the format CRs-Fixed: 12345 or link GitHub issues that are associated with Change Requests.

4 similar comments
@qswat-orbit-external

Copy link
Copy Markdown

Merge Check Failed: No CR Numbers Found

Error: No Change Request numbers were found.

Please add Change Request numbers to your pull request description in the format CRs-Fixed: 12345 or link GitHub issues that are associated with Change Requests.

@qswat-orbit-external

Copy link
Copy Markdown

Merge Check Failed: No CR Numbers Found

Error: No Change Request numbers were found.

Please add Change Request numbers to your pull request description in the format CRs-Fixed: 12345 or link GitHub issues that are associated with Change Requests.

@qswat-orbit-external

Copy link
Copy Markdown

Merge Check Failed: No CR Numbers Found

Error: No Change Request numbers were found.

Please add Change Request numbers to your pull request description in the format CRs-Fixed: 12345 or link GitHub issues that are associated with Change Requests.

@qswat-orbit-external

Copy link
Copy Markdown

Merge Check Failed: No CR Numbers Found

Error: No Change Request numbers were found.

Please add Change Request numbers to your pull request description in the format CRs-Fixed: 12345 or link GitHub issues that are associated with Change Requests.

@qlijarvis

Copy link
Copy Markdown

PR #1535 — validate-patch

PR: #1535

Verdict Issues Detailed Report
⚠️ 2 Full report

Final Summary

  1. Lore link present: Yes - https://lore.kernel.org/linux-arm-msm/20261012-wip-obbardc-soundwire-qcom-fix-port-off-by-one-v1-1-81f1a4c9c73a@oss.qualcomm.com/
  2. Lore link matches PR commits: Yes - diff content faithful to lore; context difference (ret/goto vs return) is legitimate adaptation to different base
  3. Upstream patch status: ⏳ In review - Reviewed-by from Srinivas Kandagatla (Oct 19, 2026) conditional on adding missing tags (Cc: stable, Reported-by:) and fixing incorrect speaker protection comment; no v2 posted yet
  4. PR present in qcom-next/topics: Yes - all 1 commit(s) are present in qcom-next or topics
Verdict: ⚠️ — click to expand

🔍 Patch Validation

PR: #1535 - FROMLIST: soundwire: qcom: Fix off-by-one error in port exhaustion check
Upstream commit: https://lore.kernel.org/linux-arm-msm/20261012-wip-obbardc-soundwire-qcom-fix-port-off-by-one-v1-1-81f1a4c9c73a@oss.qualcomm.com/
Verdict: ⚠️ PARTIAL

Commit Message

Check Status Note
Subject matches upstream ✅ FROMLIST: prefix added correctly; base subject identical
Body preserves rationale ✅ Full commit message preserved verbatim
Fixes tag present/correct ✅ Fixes: 6ccec91c3535 matches lore patch exactly
Authorship preserved ✅ From: matches lore author (Christopher Obbard) - correct for FROMLIST:
Backport note (if applicable) N/A Not a backport; FROMLIST: patch
Link tag present ✅ Correct lore.kernel.org link added

Diff

File Status Notes
drivers/soundwire/qcom.c ✅ Changed lines identical; context differs (ret = -EBUSY; goto out; vs return -EBUSY;) due to different base commit - legitimate adaptation

Issues

  • ⚠️ Missing tags identified by upstream reviewer: Srinivas Kandagatla's review (Oct 19, 2026) noted that Cc: stable@vger.kernel.org and Reported-by: tags are missing. The reviewer granted Reviewed-by: conditional on fixing these.
  • ⚠️ Reviewer comment not addressed: The review also noted "This comment is incorrect, we do not have speaker protection enabled on any of the devices" regarding the commit message statement about speaker protection. The PR commit message was not updated to address this feedback.

Verdict

The patch faithfully represents the lore upstream diff. The commit message and authorship are correct. However, the PR was merged without addressing the reviewer's feedback: missing Cc: stable@vger.kernel.org and Reported-by: tags, and an incorrect statement about speaker protection. These should be addressed before the patch is sent upstream in a v2 revision.

Final Summary

  1. Lore link present: Yes - https://lore.kernel.org/linux-arm-msm/20261012-wip-obbardc-soundwire-qcom-fix-port-off-by-one-v1-1-81f1a4c9c73a@oss.qualcomm.com/
  2. Lore link matches PR commits: Yes - diff content faithful to lore; context difference (ret/goto vs return) is legitimate adaptation to different base
  3. Upstream patch status: ⏳ In review - Reviewed-by from Srinivas Kandagatla (Oct 19, 2026) conditional on adding missing tags (Cc: stable, Reported-by:) and fixing incorrect speaker protection comment; no v2 posted yet
  4. PR present in qcom-next/topics: Yes - present in topics (all added lines found); not yet in qcom-next

Deterministic Integration Presence

Integration Presence Report

This report is generated by Jarvis before validate-patch runs.
It is the authoritative source for whether PR changes are already present
in qcom-next or in the kernel topic branches.

Kernel repo: /local/mnt/workspace/sgaud/Qgenie/image_pipeline/kernel
qcom-next ref: 1843874b4356d1203ebd83d5ebfc24d45aa35f1d
topics remote: topics -> https://github.com/qualcomm-linux/kernel-topics
topics fetch: fetched

Commit Subject qcom-next topics Final
1/1 [PATCH] FROMLIST: soundwire: qcom: Fix off-by-one error in port missing - no subject, patch-id, or full tree-content match found present - all checked added lines are present present

Final Status

overall_status: PASS
present_commits: 1/1
partial_commits: 0/1
missing_commits: 0/1
topics_checked_for_commits: 1/1
final_summary: PR present in qcom-next/topics: Yes - all 1 commit(s) are present in qcom-next or topics

@qlijarvis

Copy link
Copy Markdown

PR #1535 — checker-log-analyzer

PR: #1535
Checker run: https://github.com/qualcomm-linux/kernel-config/actions/runs/45583434078

Checker Result Summary
Checker Result Summary
checkpatch ❌ 2 warnings: unknown commit ID in commit body and Fixes tag
dt-binding-check ⏭️ No DT binding changes
dtb-check ⏭️ No devicetree changes
sparse-check ✅ Passed
check-uapi-headers ✅ Passed (no UAPI changes)
check-patch-compliance ✅ Passed (valid FROMLIST prefix and Link tag)
tag-check ✅ Passed (commit has valid FROMLIST: prefix)

Detailed report: Full report

Checker analysis — click to expand

🤖 CI Checker Analysis (checker-log-analyzer)

PR: #1535 - FROMLIST: soundwire: qcom: Fix off-by-one error in port exhaustion check
Source: https://github.com/qualcomm-linux/kernel-config/actions/runs/45583434078

Checker Result Summary
checkpatch ❌ 2 warnings: unknown commit ID in commit body and Fixes tag
dt-binding-check ⏭️ No DT binding changes
dtb-check ⏭️ No devicetree changes
sparse-check ✅ Passed
check-uapi-headers ✅ Passed (no UAPI changes)
check-patch-compliance ✅ Passed (valid FROMLIST prefix and Link tag)
tag-check ✅ Passed (commit has valid FROMLIST: prefix)

❌ checkpatch

Root cause: The commit references an upstream commit SHA 6ccec91c3535 that doesn't exist in the current tree (qcom-6.18.y branch).

Failure details:

WARNING: Unknown commit id '6ccec91c3535', maybe rebased or not pulled?
#11: 
Commit 6ccec91c3535 ("soundwire: qcom: Fix port exhaustion check in

WARNING: Unknown commit id '6ccec91c3535', maybe rebased or not pulled?
#36: 
Fixes: 6ccec91c3535 ("soundwire: qcom: Fix port exhaustion check in stream_alloc_ports")

26ce6cc7843fa97dea25724750a847d40b23376a total: 0 errors, 2 warnings, 0 checks, 11 lines checked

Analysis:
This is a false positive — the commit 6ccec91c3535 exists in the upstream mainline tree but not in the qcom-6.18.y branch. This is expected behavior for FROMLIST: patches that reference upstream commits not yet merged into the vendor tree. The warnings appear because:

  1. The commit body mentions the upstream commit SHA in line ci : Dry run topic branch merge #11
  2. The Fixes: tag references the upstream commit SHA in line Qcom next #36

Fix: No action required. This is an acceptable warning for FROMLIST: patches that reference upstream commits. The commit SHA is valid in the upstream context where this patch will be applied.

Reproduce locally:

./scripts/checkpatch.pl --strict --ignore FILE_PATH_CHANGES --git 5dc357c152011cb06352e9dcd15b21f5bf1af578..26ce6cc7843fa97dea25724750a847d40b23376a

Verdict

Ready to merge. The checkpatch warnings are false positives expected for FROMLIST patches that reference upstream commits not yet in the vendor tree. All other checkers passed cleanly.

Qualcomm SoundWire master ports are indexed from 1, with bit 0 of
port_mask reserved. Valid port numbers therefore range from 1 to
maxport.

Commit 69f73ad ("soundwire: qcom: Fix port exhaustion check in
stream_alloc_ports") changed the port exhaustion check from
pn > maxport to pn >= maxport which rejects the last valid port.

On RB3gen2 (QCS6490), two WSA883x speaker amplifiers are connected
to swr2, which has 8 ports. Each amplifier uses one port for playback
and another for voltage and current sensing. The right amplifier's
VISENSE port is mapped to master port 8, which is rejected by the new
check.

Since all ports in a SoundWire stream are allocated together during
hw_params, this causes the stream to fail with:

    qcom-soundwire 3250000.soundwire: All ports busy

The codec DMA backend then returns -EBUSY, preventing speaker playback.
Disabling VISENSE works around the issue but also disables speaker
protection.

The original fix addressed an exhaustion check that could never
trigger because find_first_zero_bit() returns maxport when all
searched bits are set. Include the reserved bit 0 in the search so
exhaustion returns maxport + 1 and restore the pn > maxport check.

Link: https://lore.kernel.org/linux-arm-msm/20261012-wip-obbardc-soundwire-qcom-fix-port-off-by-one-v1-1-81f1a4c9c73a@oss.qualcomm.com/
Fixes: 69f73ad ("soundwire: qcom: Fix port exhaustion check in stream_alloc_ports")
Signed-off-by: Christopher Obbard <chris.obbard@oss.qualcomm.com>
@Mohis-12
Mohis-12 force-pushed the Soundwire-port-exhaustion-fix branch from 26ce6cc to 607de7f Compare November 26, 2026 09:42
@qswat-orbit-external

Copy link
Copy Markdown

Merge Check Failed: No CR Numbers Found

Error: No Change Request numbers were found.

Please add Change Request numbers to your pull request description in the format CRs-Fixed: 12345 or link GitHub issues that are associated with Change Requests.

@qswat-orbit-external

Copy link
Copy Markdown

Merge Check Failed: No Change Task Found

No associated change tasks found for CR 4759091 on any of the following entities:

Entities:

  • kernel.qli.2.0

CR: 4759091

Please ensure the CR has a change task associated with at least one of the entities for this branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants